﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using SupportLibrary.XML;
using Automation.DAL.XML.Dao;
using Automation.Protocols.Dal;
using SupportLibrary;

namespace WpfLinqToXML
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            
            InitializeComponent();
           // XmlDataProvider e = new XmlDataProvider();
            string xmlfilepath ="MEAutomation.xml";
            string csvFile = "MEAutomation.csv";
            string csvSteps = "TSteps.csv";
            string csvTDatas = "TDatas2.csv";
            string csvTDataSet = "TDataSets.csv";
            string elementTCase = "TCase";
            string listTCase = "TCases";
            List<string> listData = FileIO.ReadFile(csvTDatas);
           // XMLProvider.CreateFile(filepath);
            XMLProvider.CreateFileFromCsv(csvFile, xmlfilepath, listTCase,elementTCase);
            //XMLProvider.AddStepsToCase(csvSteps, xmlfilepath,
            XMLProvider.AddChilds(csvSteps, xmlfilepath, elementTCase, "Name", "TStep", "TestCase");
            XMLProvider.AddChilds(csvTDatas, xmlfilepath, elementTCase, "Name", "TData", "TestCase");
            XMLProvider.AddChilds(csvTDataSet, xmlfilepath, elementTCase, "Name", "TDataSet", "TestCase");
            TCaseXMLDao xmldao = new TCaseXMLDao(xmlfilepath);
            List<TestCase> listCase = xmldao.getTestcases();
            
        }
    }
}
